Set permissions for AttrDef

Hi,

can someone help me with this script, i want to set read permission for 2 user groups for every Attribute with specific access rights. I dont get an error, but the permission aren't set.

Code:
 

logfile = write("d:\\NBT_log.csv")
 
Project p = project "/NBT"
 
Item i
 
Permission per = read
 
for i in p do
{
    if (type(i) == "Formal")
        {
                ModName_ tar = module(fullName i)
                ModuleVersion modver = moduleVersion(tar)
                Module m = load(modver, false)
 
                AttrDef ad
        
                bool isInherited
 
                logfile << fullName m "\n"
 
                for ad in m do
                {
                        
                        isAccessInheritedDef(m, ad, isInherited)
 
                                        
                        if (isInherited == false)
                        {
                                logfile << ad.name "\n"
 
                                
                                setDef(m, ad, per, "B_NBT_m")
                                setDef(m, ad, per, "B_NBT_r")
 
                                setVal(m, ad, per, "B_NBT_m")
                                setVal(m, ad, per, "B_NBT_r")
                                
                        }
                        
                } 
 
                logfile << "\n"
 
                close(m)
 
        }
}

ManuelFelger - Wed Jul 29 04:50:00 EDT 2009

Re: Set permissions for AttrDef
llandale - Wed Jul 29 09:56:06 EDT 2009

The module will need to be open Edit, and you'll need to save it afterwards.

The setVal and setDef commands return an error message which you should check.

  • Louie

Re: Set permissions for AttrDef
ManuelFelger - Wed Jul 29 10:57:22 EDT 2009

llandale - Wed Jul 29 09:56:06 EDT 2009
The module will need to be open Edit, and you'll need to save it afterwards.

The setVal and setDef commands return an error message which you should check.

  • Louie

works! thank you